﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:Controls="clr-namespace:PSE.Framework.UI.Controls.SmartClient;assembly=PSE.Framework.UI.Controls">

    <!--BEGIN TOGGLEBUTTON-->
    
    <ControlTemplate x:Key="ControlToggleButtonNormalText" TargetType="{x:Type Controls:ToggleButton}">
        <Border x:Name="Border" Background="{DynamicResource BrushToggleButtonBackground}" BorderBrush="{DynamicResource BrushToggleButtonBorder}" BorderThickness="0.7" CornerRadius="4" Height="21" Padding="5,0,5,0">
            <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" RecognizesAccessKey="True" Style="{DynamicResource ControlFont}"/>
        </Border>
        <ControlTemplate.Triggers>
            <Trigger Property="IsChecked" Value="True">
                <Setter Property="BorderBrush" Value="{DynamicResource BrushToggleButtonBorderChecked}" TargetName="Border"/>
                <Setter Property="Background" Value="{DynamicResource BrushToggleButtonBackgroundChecked}" TargetName="Border"/>
            </Trigger>
            <Trigger Property="IsMouseOver" Value="true">
                <Setter Property="Background" Value="{DynamicResource BrushToggleButtonBackgroundHover}" TargetName="Border"/>
                <Setter Property="BorderBrush" Value="{DynamicResource BrushToggleButtonBorderHover}" TargetName="Border"/>
            </Trigger>
            <Trigger Property="IsFocused" Value="true">
                <Setter Property="BorderThickness" Value="2" TargetName="Border"/>
                <Setter Property="BorderBrush" Value="{DynamicResource BrushToggleButtonBorderFocused}" TargetName="Border"/>
            </Trigger>
            <Trigger Property="IsMouseCaptured" Value="True">
                <Setter Property="Background" Value="{DynamicResource BrushToggleButtonBackgroundPressed}" TargetName="Border"/>
                <Setter Property="BorderBrush" Value="{DynamicResource BrushToggleButtonBorderPressed}" TargetName="Border"/>
            </Trigger>
            <Trigger Property="IsEnabled" Value="False">
                <Setter Property="Foreground" Value="{DynamicResource BrushToggleButtonForegroundDisabled}"/>
                <Setter Property="Background" Value="{DynamicResource BrushToggleButtonBackgroundDisabled}" TargetName="Border"/>
                <Setter Property="BorderBrush" Value="{DynamicResource BrushToggleButtonBorderDisabled}" TargetName="Border"/>
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>

    <ControlTemplate x:Key="ControlToggleButtonNormalIcon" TargetType="{x:Type Controls:ToggleButton}">
        <Border x:Name="Border" Background="{DynamicResource BrushToggleButtonBackground}" BorderBrush="{DynamicResource BrushToggleButtonBorder}" BorderThickness="0.7" CornerRadius="4" Height="21" Padding="5,0,5,0">
            <Rectangle x:Name="IconArea" Fill="{TemplateBinding Background}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="0,2"/>
        </Border>
        <ControlTemplate.Triggers>
            <Trigger Property="IsChecked" Value="True">
                <Setter Property="BorderBrush" Value="{DynamicResource BrushToggleButtonBorderChecked}" TargetName="Border"/>
                <Setter Property="Background" Value="{DynamicResource BrushToggleButtonBackgroundChecked}" TargetName="Border"/>
            </Trigger>
            <Trigger Property="IsMouseOver" Value="true">
                <Setter Property="Background" Value="{DynamicResource BrushToggleButtonBackgroundHover}" TargetName="Border"/>
                <Setter Property="BorderBrush" Value="{DynamicResource BrushToggleButtonBorderHover}" TargetName="Border"/>
            </Trigger>
            <Trigger Property="IsFocused" Value="true">
                <!--Setter Property="BorderThickness" Value="2" TargetName="Border"/-->
                <Setter Property="BorderBrush" Value="{DynamicResource BrushToggleButtonBorderFocused}" TargetName="Border"/>
            </Trigger>
            <Trigger Property="IsMouseCaptured" Value="True">
                <Setter Property="Background" Value="{DynamicResource BrushToggleButtonBackgroundPressed}" TargetName="Border"/>
                <Setter Property="BorderBrush" Value="{DynamicResource BrushToggleButtonBorderPressed}" TargetName="Border"/>
            </Trigger>
            <Trigger Property="IsEnabled" Value="False">
                <Setter Property="Foreground" Value="{DynamicResource BrushToggleButtonForegroundDisabled}"/>
                <Setter Property="Background" Value="{DynamicResource BrushToggleButtonBackgroundDisabled}" TargetName="Border"/>
                <Setter Property="BorderBrush" Value="{DynamicResource BrushToggleButtonBorderDisabled}" TargetName="Border"/>
            </Trigger>
            <Trigger Property="Icon" Value="IconButtonTimer">
                <Setter Property="Width" Value="24"/>
                <Setter Property="Margin" Value="-1,2" TargetName="IconArea"/>
            </Trigger>
            <Trigger Property="Icon" Value="IconButtonDocument">
                <Setter Property="Width" Value="22.5"/>
            </Trigger>
            <Trigger Property="Icon" Value="IconButtonLink">
                <Setter Property="Width" Value="24"/>
                <Setter Property="Margin" Value="-1,2" TargetName="IconArea"/>
            </Trigger>
            <Trigger Property="Icon" Value="IconButtonEdit">
                <Setter Property="Width" Value="23"/>
                <Setter Property="Margin" Value="-1,2" TargetName="IconArea"/>
                <Setter Property="ToolTip" Value="{DynamicResource Infra.Controls.Tooltip.Editar}"/>
            </Trigger>
            <Trigger Property="Icon" Value="IconButtonSearchDocument">
                <Setter Property="Width" Value="22.5"/>
                <Setter Property="Margin" Value="0,2,-1,2" TargetName="IconArea"/>
            </Trigger>
            <Trigger Property="Icon" Value="IconButtonRefresh">
                <Setter Property="Width" Value="24"/>
                <Setter Property="Margin" Value="-1,2" TargetName="IconArea"/>
                <Setter Property="ToolTip" Value="{DynamicResource Infra.Controls.Tooltip.Atualizar}"/>
            </Trigger>
            <Trigger Property="Icon" Value="IconButtonSearch">
                <Setter Property="Width" Value="23"/>
                <Setter Property="Margin" Value="-1,2" TargetName="IconArea"/>
                <Setter Property="ToolTip" Value="{DynamicResource Infra.Controls.Tooltip.Pesquisar}"/>
            </Trigger>
            <Trigger Property="Icon" Value="IconButtonOK">
                <Setter Property="Width" Value="23"/>
                <Setter Property="Margin" Value="-1,4" TargetName="IconArea"/>
            </Trigger>
            <Trigger Property="Icon" Value="IconButtonSave">
                <Setter Property="Width" Value="23.5"/>
                <Setter Property="Margin" Value="-1,2" TargetName="IconArea"/>
                <Setter Property="ToolTip" Value="{DynamicResource Infra.Controls.Tooltip.Salvar}"/>
            </Trigger>
            <Trigger Property="Icon" Value="IconButtonCancel">
                <Setter Property="Width" Value="24"/>
                <Setter Property="Margin" Value="-1,3" TargetName="IconArea"/>
                <Setter Property="ToolTip" Value="{DynamicResource Infra.Controls.Label.Cancelar}"/>
            </Trigger>
            <Trigger Property="Icon" Value="IconButtonDelete">
                <Setter Property="Width" Value="22"/>
                <Setter Property="Margin" Value="-1,2" TargetName="IconArea"/>
                <Setter Property="ToolTip" Value="{DynamicResource Infra.Controls.Label.Excluir}"/>
            </Trigger>
            <Trigger Property="Icon" Value="IconButtonClient">
                <Setter Property="Width" Value="22"/>
                <Setter Property="Margin" Value="-1,2" TargetName="IconArea"/>
            </Trigger>
            <Trigger Property="Icon" Value="IconButtonClients">
                <Setter Property="Width" Value="28"/>
                <Setter Property="Margin" Value="-2,2" TargetName="IconArea"/>
            </Trigger>
            <Trigger Property="Icon" Value="IconButtonCopy">
                <Setter Property="Width" Value="24.5"/>
                <Setter Property="Margin" Value="-1,2" TargetName="IconArea"/>
                <Setter Property="ToolTip" Value="{DynamicResource Infra.Controls.Label.Copiar}"/>
            </Trigger>
            <Trigger Property="Icon" Value="IconButtonSetting">
                <Setter Property="Width" Value="27"/>
                <Setter Property="Margin" Value="-1,2" TargetName="IconArea"/>
                <Setter Property="ToolTip" Value="{DynamicResource Infra.Controls.Tooltip.Configurar}"/>
            </Trigger>
            <Trigger Property="Icon" Value="IconButtonCut">
                <Setter Property="Width" Value="25"/>
                <Setter Property="Margin" Value="-1,2.5" TargetName="IconArea"/>
                <Setter Property="ToolTip" Value="{DynamicResource Infra.Controls.Tooltip.Cortar}"/>
            </Trigger>
            <Trigger Property="Icon" Value="IconButtonPrint">
                <Setter Property="Width" Value="23"/>
                <Setter Property="Margin" Value="-1,2" TargetName="IconArea"/>
                <Setter Property="ToolTip" Value="{DynamicResource Infra.Controls.Tooltip.Imprimir}"/>
            </Trigger>
            <Trigger Property="Icon" Value="IconButtonNew">
                <Setter Property="Width" Value="23"/>
                <Setter Property="Margin" Value="-1,2,-3,2" TargetName="IconArea"/>
            </Trigger>
            <Trigger Property="Icon" Value="IconButtonUndoAll">
                <Setter Property="Width" Value="27"/>
                <Setter Property="Margin" Value="-1.5,1,-2,2" TargetName="IconArea"/>
                <Setter Property="ToolTip" Value="{DynamicResource Infra.Controls.Label.DesfazerTudo}"/>
            </Trigger>
            <Trigger Property="Icon" Value="IconButtonUndoLast">
                <Setter Property="Width" Value="23"/>
                <Setter Property="Margin" Value="-1,2" TargetName="IconArea"/>
                <Setter Property="ToolTip" Value="{DynamicResource Infra.Controls.Tooltip.DesfazerUltimaAcao}"/>
            </Trigger>
            <Trigger Property="Icon" Value="IconButtonSearchDB">
                <Setter Property="Width" Value="29"/>
                <Setter Property="Margin" Value="-1,4,-1,2" TargetName="IconArea"/>
            </Trigger>
            <Trigger Property="Icon" Value="IconButtonPaste">
                <Setter Property="Margin" Value="-0.5,2" TargetName="IconArea"/>
                <Setter Property="ToolTip" Value="{DynamicResource Infra.Controls.Tooltip.Colar}"/>
            </Trigger>
            <Trigger Property="Icon" Value="IconButtonExcel">
                <Setter Property="Width" Value="26"/>
                <Setter Property="Margin" Value="-2,2" TargetName="IconArea"/>
                <Setter Property="ToolTip" Value="{DynamicResource Infra.Controls.Tooltip.ExportarExcel}"/>
            </Trigger>
            <Trigger Property="Icon" Value="IconButtonSaveManual">
                <Setter Property="Width" Value="38.72"/>
                <Setter Property="Margin" Value="-2,2" TargetName="IconArea"/>
                <Setter Property="ToolTip" Value="{DynamicResource Infra.Controls.Label.SalvarManual}"/>
            </Trigger>
            <Trigger Property="Icon" Value="IconButtonSaveAutomatic">
                <Setter Property="Width" Value="38.62"/>
                <Setter Property="Margin" Value="-2,2" TargetName="IconArea"/>
                <Setter Property="ToolTip" Value="{DynamicResource Infra.Controls.Label.SalvarAutomatico}"/>
            </Trigger>
            <Trigger Property="Icon" Value="IconButtonErase">
                <Setter Property="Width" Value="28"/>
                <Setter Property="Margin" Value="-2,4" TargetName="IconArea"/>
                <Setter Property="ToolTip" Value="{DynamicResource Infra.Controls.Label.Apagar}"/>
            </Trigger>
            <Trigger Property="Icon" Value="IconButtonRightArrow">
                <Setter Property="Width" Value="22"/>
                <Setter Property="Margin" Value="-2,2" TargetName="IconArea"/>
            </Trigger>
            <Trigger Property="Icon" Value="IconButtonLeftArrow">
                <Setter Property="Width" Value="22"/>
                <Setter Property="Margin" Value="-2,2" TargetName="IconArea"/>
            </Trigger>
            <Trigger Property="Icon" Value="IconButtonBottomArrow">
                <Setter Property="Width" Value="22"/>
                <Setter Property="Margin" Value="-2,2" TargetName="IconArea"/>
            </Trigger>
            <Trigger Property="Icon" Value="IconButtonTopArrow">
                <Setter Property="Width" Value="22"/>
                <Setter Property="Margin" Value="-2,2" TargetName="IconArea"/>
            </Trigger>
            <Trigger Property="Icon" Value="IconButtonBrowse">
                <Setter Property="Margin" Value="-2,8.5" TargetName="IconArea"/>
                <Setter Property="ToolTip" Value="{DynamicResource Infra.Controls.Label.Buscar}"/>
            </Trigger>
            <Trigger Property="Icon" Value="IconButtonNewSearch">
                <Setter Property="Width" Value="21"/>
                <Setter Property="Margin" Value="-2,2" TargetName="IconArea"/>
                <Setter Property="ToolTip" Value="{DynamicResource Infra.Controls.Label.NovaPesquisa}"/>
            </Trigger>
            <Trigger Property="Icon" Value="IconButtonSettle">
                <Setter Property="ToolTip" Value="{DynamicResource Infra.Controls.Label.Liquidar}"/>
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>

    <ControlTemplate x:Key="ControlToggleButtonNavigation" TargetType="{x:Type Controls:ToggleButton}">
        <Border x:Name="Border" Background="{DynamicResource BrushToggleButtonNavigationBackground}" BorderBrush="{DynamicResource BrushToggleButtonNavigationBorder}" BorderThickness="0.7" CornerRadius="4" Height="20" Padding="5,0,5,0">
            <ContentPresenter x:Name="Content" Margin="0,-1.5,0,0" HorizontalAlignment="Center" VerticalAlignment="Center" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" RecognizesAccessKey="True" Style="{DynamicResource ControlFont}" TextElement.Foreground="{TemplateBinding Foreground}"/>
        </Border>
        <ControlTemplate.Triggers>
            <Trigger Property="IsMouseOver" Value="true">
                <Setter Property="Background" Value="{DynamicResource BrushToggleButtonNavigationBackgroundHover}" TargetName="Border"/>
            </Trigger>
            <Trigger Property="IsFocused" Value="true">
                <Setter Property="Background" Value="{DynamicResource BrushToggleButtonNavigationBackgroundHover}" TargetName="Border"/>
            </Trigger>
            <Trigger Property="IsChecked" Value="True">
                <Setter Property="TextElement.Foreground" Value="{DynamicResource BrushToggleButtonNavigationForegroundChecked}" TargetName="Content"/>
                <Setter Property="Background" Value="{DynamicResource BrushToggleButtonNavigationBackgroundChecked}" TargetName="Border"/>
                <Setter Property="BorderThickness" Value="2.5" TargetName="Border"/>
                <Setter Property="Margin" Value="0,-2,0,0" TargetName="Content"/>
                <Setter Property="BorderBrush" Value="{DynamicResource BrushToggleButtonNavigationBorderChecked}" TargetName="Border"/>
            </Trigger>
            <Trigger Property="IsMouseCaptured" Value="True">
                <Setter Property="TextElement.Foreground" Value="{DynamicResource BrushToggleButtonNavigationForegroundChecked}" TargetName="Content"/>
                <Setter Property="Background" Value="{DynamicResource BrushToggleButtonNavigationBackgroundChecked}" TargetName="Border"/>
                <Setter Property="BorderThickness" Value="2.5" TargetName="Border"/>
                <Setter Property="Margin" Value="0,-2,0,0" TargetName="Content"/>
                <Setter Property="BorderBrush" Value="{DynamicResource BrushToggleButtonNavigationBorderChecked}" TargetName="Border"/>
            </Trigger>
            <Trigger Property="IsEnabled" Value="False">
                <Setter Property="TextElement.Foreground" Value="{DynamicResource BrushToggleButtonNavigationForegroundDisabled}" TargetName="Content"/>
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>

    <Style TargetType="{x:Type Controls:ToggleButton}">
        <Setter Property="Foreground" Value="{DynamicResource BrushToggleButtonForeground}"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="CausesValidation" Value="False"/>
        <Setter Property="Width" Value="21"/>
        <Setter Property="Height" Value="21"/>
        <Setter Property="Template" Value="{StaticResource ControlToggleButtonNormalIcon}"/>
        <Style.Triggers>
            <Trigger Property="ToggleButtonType" Value="Navigation">
                <Setter Property="Height" Value="20"/>
                <Setter Property="Width" Value="100"/>
                <Setter Property="Foreground" Value="{DynamicResource BrushToggleButtonNavigationForeground}"/>
                <Setter Property="Template" Value="{StaticResource ControlToggleButtonNavigation}"/>
            </Trigger>
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="ToggleButtonType" Value="Normal"/>
                    <Condition Property="Icon" Value="{x:Null}"/>
                </MultiTrigger.Conditions>
                <Setter Property="Width" Value="100"/>
                <Setter Property="Template" Value="{StaticResource ControlToggleButtonNormalText}"/>
            </MultiTrigger>
        </Style.Triggers>
    </Style>
    
    <!--END TOGGLEBUTTON-->
    
    <!--BEGIN WINDOW HELP BUTTONS-->

    <Style x:Key="ControlToggleButtonForward" TargetType="{x:Type ToggleButton}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ToggleButton}">
                    <Grid Width="19" Height="19" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,0,0,0">
                        <Path x:Name="Background" Stretch="Fill" StrokeLineJoin="Round" Stroke="{DynamicResource BrushExpanderButtonStroke}" Width="Auto" Height="Auto" Canvas.Left="0" Canvas.Top="0" StrokeThickness="1" Data="{DynamicResource IconExpanderButtonExpandBackground}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Fill="{DynamicResource BrushExpanderButtonExpandBackground}" />
                        <Path x:Name="BackgroundEffectTop" Width="Auto" Height="Auto" Canvas.Left="2.2" Canvas.Top="1.2" Stretch="Fill" Data="{DynamicResource IconExpanderButtonExpandTopEffect}" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="2.5,1.2,2.5,6.2" Fill="{DynamicResource BrushExpanderButtonExpandTopEffectBackground}" />
                        <Path x:Name="BackgroundEffectBottom" Width="Auto" Height="Auto" Canvas.Left="1.5" Canvas.Top="1.4" Stretch="Fill" Data="{DynamicResource IconExpanderButtonExpandBottomEffect}" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="1.4,1.8,1.4,1.4" Fill="{DynamicResource BrushExpanderButtonExpandBottomEffectBackground}" />
                        <Path x:Name="Icon" Width="13.2" Height="7.2" Canvas.Left="2.85" Canvas.Top="6.2" Stretch="Fill" StrokeThickness="1" StrokeLineJoin="Round" Stroke="{DynamicResource BrushExpanderButtonIconStroke}" Fill="{DynamicResource BrushExpanderButtonIconBackground}" Data="{DynamicResource IconExpanderButtonExpand}" HorizontalAlignment="Left" VerticalAlignment="Top" RenderTransformOrigin="0.5,0.5" Margin="3.6,5.5,0,0">
                            <Path.RenderTransform>
                                <TransformGroup>
                                    <ScaleTransform ScaleX="1" ScaleY="-1"/>
                                    <SkewTransform AngleX="0" AngleY="0"/>
                                    <RotateTransform Angle="-90"/>
                                    <TranslateTransform X="0" Y="0"/>
                                </TransformGroup>
                            </Path.RenderTransform>
                        </Path>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter Property="Fill" Value="{DynamicResource BrushExpanderButtonIconBackgroundHover}" TargetName="Icon"/>
                            <Setter Property="Fill" Value="{DynamicResource BrushExpanderButtonExpandBottomEffectBakgroundHover}" TargetName="BackgroundEffectBottom"/>
                        </Trigger>
                        <Trigger Property="IsChecked" Value="False">
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="Fill" TargetName="Background" Value="{DynamicResource BrushExpanderBackgroundDisabled}" />
                            <Setter Property="Fill" TargetName="BackgroundEffectBottom" Value="{DynamicResource BrushExpanderBackgroundEffectBottomDisabled }"/>
                            <Setter Property="Stroke" TargetName="Background" Value="{DynamicResource BrushExpanderBackgroundStrokeDisabled}"/>
                            <Setter Property="Margin" TargetName="BackgroundEffectBottom" Value="1,1,1,1"/>
                            <Setter Property="Fill" TargetName="Icon" Value="{DynamicResource BrushExpanderBackgroundIconDisabled}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="ControlToggleButtonBackward" TargetType="{x:Type ToggleButton}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ToggleButton}">
                    <Grid Width="19" Height="19" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,0,0,0">
                        <Path x:Name="Background" Width="Auto" Height="Auto" Canvas.Left="0" Canvas.Top="0" Stretch="Fill" StrokeThickness="1" StrokeLineJoin="Round" Stroke="{DynamicResource BrushExpanderButtonStroke}" Data="{DynamicResource IconExpanderButtonExpandBackground}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Fill="{DynamicResource BrushExpanderButtonExpandBackground}" />
                        <Path x:Name="BackgroundEffectTop" Width="Auto" Height="Auto" Canvas.Left="2.2" Canvas.Top="1.2" Stretch="Fill" Data="{DynamicResource IconExpanderButtonExpandTopEffect}" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="2.5,1.2,2.5,6.2" Fill="{DynamicResource BrushExpanderButtonExpandTopEffectBackground}" />
                        <Path x:Name="BackgroundEffectBottom" Width="Auto" Height="Auto" Canvas.Left="1.5" Canvas.Top="1.4" Stretch="Fill" Data="{DynamicResource IconExpanderButtonExpandBottomEffect}" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="1.4,1.8,1.4,1.4" Fill="{DynamicResource BrushExpanderButtonExpandBottomEffectBackground}" />
                        <Path x:Name="Icon" Width="13.2" Height="7.2" Canvas.Left="2.85" Canvas.Top="6.2" Stretch="Fill" StrokeThickness="1" StrokeLineJoin="Round" Stroke="{DynamicResource BrushExpanderButtonIconStroke}" Fill="{DynamicResource BrushExpanderButtonIconBackground}" Data="{DynamicResource IconExpanderButtonExpand}" HorizontalAlignment="Right" VerticalAlignment="Top" RenderTransformOrigin="0.5,0.5" Margin="0,5.5,3.7,0">
                            <Path.RenderTransform>
                                <TransformGroup>
                                    <ScaleTransform ScaleX="-1" ScaleY="-1"/>
                                    <SkewTransform AngleX="0" AngleY="0"/>
                                    <RotateTransform Angle="90"/>
                                    <TranslateTransform X="0" Y="0"/>
                                </TransformGroup>
                            </Path.RenderTransform>
                        </Path>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter Property="Fill" Value="{DynamicResource BrushExpanderButtonIconBackgroundHover}" TargetName="Icon"/>
                            <Setter Property="Fill" Value="{DynamicResource BrushExpanderButtonExpandBottomEffectBakgroundHover}" TargetName="BackgroundEffectBottom"/>
                        </Trigger>
                        <Trigger Property="IsChecked" Value="False">
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="Fill" TargetName="Background" Value="{DynamicResource BrushExpanderBackgroundDisabled}" />
                            <Setter Property="Fill" TargetName="BackgroundEffectBottom" Value="{DynamicResource BrushExpanderBackgroundEffectBottomDisabled }"/>
                            <Setter Property="Stroke" TargetName="Background" Value="{DynamicResource BrushExpanderBackgroundStrokeDisabled}"/>
                            <Setter Property="Margin" TargetName="BackgroundEffectBottom" Value="1,1,1,1"/>
                            <Setter Property="Fill" TargetName="Icon" Value="{DynamicResource BrushExpanderBackgroundIconDisabled}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="ControlToggleButtonHome" TargetType="{x:Type ToggleButton}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ToggleButton}">
                    <Grid Width="19" Height="19" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,0,0,0">
                        <Path x:Name="Background" Width="Auto" Height="Auto" Canvas.Left="0" Canvas.Top="0" Stretch="Fill" StrokeThickness="1" StrokeLineJoin="Round" Stroke="{DynamicResource BrushExpanderButtonStroke}" Data="{DynamicResource IconExpanderButtonExpandBackground}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Fill="{DynamicResource BrushExpanderButtonExpandBackground}" />
                        <Path x:Name="BackgroundEffectTop" Width="Auto" Height="Auto" Canvas.Left="2.2" Canvas.Top="1.2" Stretch="Fill" Data="{DynamicResource IconExpanderButtonExpandTopEffect}" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="2.5,1.2,2.5,6.2" Fill="{DynamicResource BrushExpanderButtonExpandTopEffectBackground}" />
                        <Path x:Name="BackgroundEffectBottom" Width="Auto" Height="Auto" Canvas.Left="1.5" Canvas.Top="1.4" Stretch="Fill" Data="{DynamicResource IconExpanderButtonExpandBottomEffect}" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="1.4,1.8,1.4,1.4" Fill="{DynamicResource BrushExpanderButtonExpandBottomEffectBackground}" />

                        <Path Stretch="Fill" StrokeLineJoin="Miter" Stroke="{DynamicResource BrushExpanderButtonIconStroke}" Fill="{DynamicResource BrushExpanderButtonIconBackground}" 
                              Data="F1 M0.19895953,5.8730983 L6.67314,0.5 13.165607,5.8673112 11.0481,5.8673112 11.0481,12.21389 2.44145,12.21389 2.44145,5.8673883 0.19895953,5.8730983 z" 
                              Margin="0,2.5,0,0" StrokeThickness="1" x:Name="Icon" 
                              HorizontalAlignment="Center" VerticalAlignment="Top" Canvas.Top="6.348" Canvas.Left="7.136" Width="14" Height="12.5"/>

                        <Path Stretch="Fill" Stroke="{DynamicResource BrushExpanderButtonIconStroke}" StrokeThickness="2" HorizontalAlignment="Center" 
                              Margin="0,9.5,0,0" x:Name="Icon2" Width="3" 
                              Data="M0,0 L2.863,0 L2.863,3.818 L0,3.818 z" 
                              VerticalAlignment="Top" Canvas.Top="25.943" Canvas.Left="23.75" Height="5" />
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter Property="Fill" Value="{DynamicResource BrushExpanderButtonIconBackgroundHover}" TargetName="Icon"/>
                            <Setter Property="Fill" Value="{DynamicResource BrushExpanderButtonExpandBottomEffectBakgroundHover}" TargetName="BackgroundEffectBottom"/>
                        </Trigger>
                        <Trigger Property="IsChecked" Value="False">
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="Fill" TargetName="Background" Value="{DynamicResource BrushExpanderBackgroundDisabled}" />
                            <Setter Property="Fill" TargetName="BackgroundEffectBottom" Value="{DynamicResource BrushExpanderBackgroundEffectBottomDisabled }"/>
                            <Setter Property="Stroke" TargetName="Background" Value="{DynamicResource BrushExpanderBackgroundStrokeDisabled}"/>
                            <Setter Property="Margin" TargetName="BackgroundEffectBottom" Value="1,1,1,1"/>
                            <Setter Property="Fill" TargetName="Icon" Value="{DynamicResource BrushExpanderBackgroundIconDisabled}"/>
                        </Trigger>                        
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>    

    <!--END WINDOW HELP BUTTONS-->
    
   
    
</ResourceDictionary>